<!DOCTYPE HTML>
<html>

<head>
        <title></title>

        <script type="text/javascript">
function myobject() 
{ 
} 

myobject.prototype.handler = function(arg) 
{ 
  alert('this is ' + this + ' handling ' + arg); 
} 

myobject.prototype.create_handler = function(my_this) 
{ 
  return function(arg) { my_this.handler(arg) } 
} 


        </script>

        <style type="text/css">
        </style>
</head>



<body>
        <script type="text/javascript">

var myinstance = new myobject('one', 'two', 'three'); 
myinstance.handler("zaijian");
var handler2 = myinstance.create_handler(myinstance); 
handler2("nihao");

        </script>

</body>



</html>

